package com.mzj.saas.mservice.lockManager.repository;

import com.mzj.saas.mservice.lockManager.entity.SmartLockBrand;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

public interface SmartLockBrandRepository extends PagingAndSortingRepository<SmartLockBrand, Long>, JpaSpecificationExecutor<SmartLockBrand> {
    @Modifying
    @Query(value = "UPDATE `saas_smart_lock_brand` b SET b.status=?2 WHERE b.`id` = ?1", nativeQuery = true)
    int updateStatus(Long id, int status);

    @Modifying
    @Query(value = "UPDATE `saas_smart_lock_brand` b SET b.del_status=?2 WHERE b.`id` = ?1", nativeQuery = true)
    int updateDelStatus(Long id, int status);

}
